<template>
  <div class="add_coupons">
    <el-form :model="addForm" label-width="120px" label-position="right">
      <el-form-item label="时长:">
        <el-input-number v-model="addForm.parkingDuration" :min="1" size="mini"></el-input-number> 小时
      </el-form-item>
      <el-form-item label="金额:">
        <el-input-number v-model="addForm.sellPrice" :min="1" size="mini"></el-input-number> 元
      </el-form-item>
      <el-form-item label="有效期:">
        <el-input-number v-model="addForm.validityDays" :min="1" size="mini"></el-input-number> 天
      </el-form-item>
    </el-form>

    <p style="text-align: center;">
      <el-button size="mini" type="primary" @click="confirm">确定</el-button>
    </p>

  </div>
</template>

<script>
  export default {
    data() {
      return {
        addForm: {
          parkingDuration: '1',
          sellPrice: '1',
          validityDays: '1'
        }
      }
    },

    mounted() {

    },

    methods: {
      confirm() {
        this.$axios({
          method: 'post',
          url: '/business/park-ticket-rule/add',
          data: this.addForm
        }).then((res) => {
          if(res.code == 200) {
            this.$message.success('新增停车券成功');
            this.$emit('closeDialog');
            this.$emit('refresh');
          } else {
            this.$message.warning(res.desc);
          }
        })
      }
    }
  }
</script>

<style scoped>





</style>
